import torch.nn as nn
from config import *

class QNet(nn.Module):
    def __init__(self, n_in, n_out):
        super().__init__()
        mid = int(n_in * 1.5 // 2 * 2)   # 与论文式(15)一致
        self.net = nn.Sequential(
            nn.Linear(n_in, mid),
            nn.ReLU(),
            nn.Linear(mid, mid),
            nn.ReLU(),
            nn.Linear(mid, n_out)
        )

    def forward(self, x):
        return self.net(x)